import yaml

with open("data.yaml",encoding="utf-8") as f:
    s_yaml=f.read()
    d_yaml=yaml.safe_load(s_yaml)
    print(d_yaml)